package com.example.chapter07;

public class Circle {
    private final double PI = 3.14;
    private double radius; // 圆半径
    private double area; // 圆面积

    // 构造函数
    public Circle() {
    }

    // 设置圆的半径
    public void setRadius(double radius) {
        this.radius = radius;
    }

    // 获取圆的半径
    public double getRadius() {
        return radius;
    }

    // 计算圆的面积
    public double calculateArea() {
        area = PI * radius * radius;
        return area;
    }

    // 获取圆的面积
    public double getArea() {
        return area;
    }
}